home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_item_boatcrank.cog < prev    next >
Text File  |  1999-11-15  |  2KB  |  95 lines

  1. # Jones 3D Cog Script
  2. #
  3. # item_BoatCrank.cog
  4. #
  5. # [RT]
  6. #
  7. # (C) 1998 LucasArts Entertainment Company LLC. All Rights Reserved
  8. #
  9. # ===================================================================
  10.  
  11. symbols
  12.  
  13. message    startup
  14. message    activated
  15. message    touched
  16. message    taken
  17.  
  18. cog        talkCog                    local
  19.  
  20. sound    foundSnd=INXJ248.wav    local
  21. sound    foundSnd2=INXJ184.wav    local
  22.  
  23. thing    player                    local
  24.  
  25. int        bin=113                    local
  26.  
  27. end
  28.  
  29. # ===================================================================
  30.  
  31. code
  32.  
  33. startup:
  34.  
  35.     # Reset the "I've seen the boat" variable
  36.     global14 = 0;
  37.     return;
  38.  
  39. # -------------------------------------------------------------------
  40.  
  41. activated:
  42.  
  43.     StartCutscene(0);
  44.  
  45.     talkCog = GetCogByIndex(0);
  46.     SendMessage(talkCog, 27);
  47.  
  48.     if (Rand() < 0.5)
  49.     {
  50.         SetExtCamOffset('0.15 -0.05 0.04');
  51.     }
  52.     else
  53.     {
  54.         SetExtCamOffset('-0.15 -0.05 0.04');
  55.     }
  56.     SetExtCamLookOffset('0.0 0.02 -0.01');
  57.  
  58.     return;
  59.  
  60. # -------------------------------------------------------------------
  61.  
  62. touched:
  63.  
  64.     player = GetSourceRef();
  65.  
  66.     if (GetInv(player, bin) < GetInvMax(player, bin))
  67.     {
  68.         TakeItem(GetSenderRef(), player);
  69.     }
  70.     else
  71.     {
  72.         EndCutscene();
  73.     }
  74.  
  75.     return;
  76.  
  77. # -------------------------------------------------------------------
  78.  
  79. taken:
  80.  
  81.     player = GetSourceRef();
  82.  
  83.     ChangeInv(player, bin, 1.0);
  84.     SetInvAvailable(player, bin, 1);
  85.     JonesInvItemChanged(bin);
  86.  
  87.     Sleep(1.0);
  88.     PlayVoice(player, foundSnd[global14], 1.0, 0);
  89.  
  90.     EndCutscene();
  91.  
  92.     return;
  93.  
  94. end
  95.